home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIDemos.lzh / Anarchy_Leftovers.lha / Leftovers / Install_Leftovers next >
Text File  |  1999-11-04  |  3KB  |  177 lines

  1. ;****************************
  2. (set #sub-dir "LeftoversData")
  3. (set #readme-file "leftovershd.readme")    ;name of readme file
  4. (set #last-file "partypic")    ;last file the imager should create
  5.  
  6. ;****************************
  7. ;----------------------------
  8. ; Checks if given program is reachable via the path
  9. ; if not abort install
  10. ; IN:  #program - to check
  11. ; OUT: -
  12.  
  13. (procedure P_chkrun
  14.   (if
  15.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  16.     ("")
  17.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  18.   )
  19. )
  20.  
  21. (procedure P_disk
  22.   (askdisk
  23.     (dest #AD_disk)
  24.     (prompt ("\nInsert Disk 1 in any drive !"))
  25.     (help @askdisk-help)
  26.   )
  27. )
  28.  
  29. ;****************************
  30.  
  31. (if
  32.   (exists #readme-file)
  33.   (if 
  34.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  35.     ("")
  36.     (run ("SYS:Utilities/More %s" #readme-file))
  37.   )
  38. )
  39.  
  40. (set #program "WHDLoad")
  41. (P_chkrun)
  42.  
  43. (set #program "RawDIC")
  44. (P_chkrun)
  45.  
  46. (if
  47.   (= @user-level 2)
  48.   (
  49.     (set #CI_drive
  50.       (askchoice
  51.     (prompt "Select source drive for diskimages")
  52.     (default 0)
  53.     (choices "DF0:" "DF1:" "DF2:" "DF3:")
  54.     (help @askchoice-help)
  55.       )
  56.     )
  57.     (select #CI_drive
  58.       (set #CI_drive "DF0:")
  59.       (set #CI_drive "DF1:")
  60.       (set #CI_drive "DF2:")
  61.       (set #CI_drive "DF3:")
  62.     )
  63.   )
  64.   (set #CI_drive "DF0:")
  65. )
  66.  
  67. (set @default-dest
  68.   (askdir
  69.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  70.     (help @askdir-help)
  71.     (default @default-dest)
  72.     (disk)
  73.   )
  74. )
  75. (set #dest (tackon @default-dest @app-name))
  76. (if
  77.   (exists #dest)
  78.   (
  79.     (set #choice
  80.       (askbool
  81.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  82.         (default 1)
  83.         (choices "Delete" "Skip")
  84.         (help @askbool-help)
  85.       )
  86.     )
  87.     (if
  88.       (= #choice 1)
  89.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  90.     )
  91.   )
  92. )
  93.  
  94. (makedir #dest
  95.   (help @makedir-help)
  96.   (infos)
  97. )
  98.  
  99.  
  100. ;----------------------------
  101.  
  102. (if
  103.   (exists ("%s.newicon" @app-name))
  104.   (set #icon
  105.     (askchoice
  106.       (prompt "\nWhich icon do you like to install ?\n")
  107.       (default 0)
  108.       (choices "Normal" "NewIcon")
  109.       (help @askchoice-help)
  110.     )
  111.   )
  112.   (set #icon 0)
  113. )
  114. (select #icon
  115.   (set #icon ("%s.inf" @app-name))
  116.   (set #icon ("%s.newicon" @app-name))
  117. )
  118. (copyfiles
  119.   (help @copyfiles-help)
  120.   (source #icon)
  121.   (newname ("%s.info" @app-name))
  122.   (dest #dest)
  123. )
  124. (copyfiles
  125.   (help @copyfiles-help)
  126.   (source ("%s.slave" @app-name ))
  127.   (dest #dest)
  128. )
  129. (if
  130.   (exists #readme-file)
  131.   (copyfiles
  132.     (help @copyfiles-help)
  133.     (source #readme-file)
  134.     (dest #dest)
  135.   )
  136. )
  137. (if
  138.   (exists ("%s.info" #readme-file))
  139.   (copyfiles
  140.     (help @copyfiles-help)
  141.     (source ("%s.info" #readme-file))
  142.     (dest #dest)
  143.   )
  144. )
  145.  
  146. (if
  147.   (= #sub-dir "")
  148.   ("")
  149.   (
  150.     (set #dest (tackon #dest #sub-dir))
  151.     (makedir #dest
  152.       (help @makedir-help)
  153.     )
  154.   )
  155. )
  156.  
  157. (copyfiles
  158.   (help @copyfiles-help)
  159.   (source ("%s.islave" @app-name))
  160.   (dest #dest)
  161. )
  162.  
  163. (working)
  164. (run ("CD \"%s\"\nRawDIC SLAVE=%s.islave SOURCE=%s\nDelete %s.islave" #dest @app-name #CI_drive @app-name))
  165.  
  166. (if
  167.   (exists (tackon #dest #last-file))
  168.   ("")
  169.   (abort "Diskimaging not successful !\nRawDIC was unable to create all needed files !")
  170. )
  171.  
  172. ;----------------------------
  173.  
  174. (run ("Delete %s ALL QUIET FORCE" #cleanup))    ;delete temporary files
  175.  
  176. (exit)
  177.